/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package smartgrid;

import java.util.List;
import org.hibernate.criterion.DetachedCriteria;
import org.orm.PersistentSession;
import org.orm.criteria.*;

public class ContractDetachedCriteria extends AbstractORMDetachedCriteria {
	public final IntegerExpression ID;
	public final StringExpression Number;
	public final StringExpression ClientNif;
	public final StringExpression ClientName;
	public final StringExpression Morada;
	
	public ContractDetachedCriteria() {
		super(smartgrid.Contract.class, smartgrid.ContractCriteria.class);
		ID = new IntegerExpression("ID", this.getDetachedCriteria());
		Number = new StringExpression("Number", this.getDetachedCriteria());
		ClientNif = new StringExpression("ClientNif", this.getDetachedCriteria());
		ClientName = new StringExpression("ClientName", this.getDetachedCriteria());
		Morada = new StringExpression("Morada", this.getDetachedCriteria());
	}
	
	public ContractDetachedCriteria(DetachedCriteria aDetachedCriteria) {
		super(aDetachedCriteria, smartgrid.ContractCriteria.class);
		ID = new IntegerExpression("ID", this.getDetachedCriteria());
		Number = new StringExpression("Number", this.getDetachedCriteria());
		ClientNif = new StringExpression("ClientNif", this.getDetachedCriteria());
		ClientName = new StringExpression("ClientName", this.getDetachedCriteria());
		Morada = new StringExpression("Morada", this.getDetachedCriteria());
	}
	
	public SupplierDetachedCriteria createSupplier_roleCriteria() {
		return new SupplierDetachedCriteria(createCriteria("supplier_role"));
	}
	
	public TariffDetachedCriteria createTariff_CurrentTarif_roleCriteria() {
		return new TariffDetachedCriteria(createCriteria("Tariff_CurrentTarif_role"));
	}
	
	public FaceBookAccountDetachedCriteria createFaceBookAccount_roleCriteria() {
		return new FaceBookAccountDetachedCriteria(createCriteria("ORM_FaceBookAccount_role"));
	}
	
	public TariffDetachedCriteria createTariff_PreviusTariffs_roleCriteria() {
		return new TariffDetachedCriteria(createCriteria("ORM_Tariff_PreviusTariffs_role"));
	}
	
	public DataLineDetachedCriteria createDataLinesCriteria() {
		return new DataLineDetachedCriteria(createCriteria("ORM_DataLines"));
	}
	
	public AnnotationDetachedCriteria createAnnotationsCriteria() {
		return new AnnotationDetachedCriteria(createCriteria("ORM_Annotations"));
	}
	
	public DiaAgregadoDetachedCriteria createDiaAgregadosCriteria() {
		return new DiaAgregadoDetachedCriteria(createCriteria("ORM_DiaAgregados"));
	}
	
	public MesAgregadoDetachedCriteria createMesAgregadosCriteria() {
		return new MesAgregadoDetachedCriteria(createCriteria("ORM_MesAgregados"));
	}
	
	public SemanaAgregadaDetachedCriteria createSemanaAgregadasCriteria() {
		return new SemanaAgregadaDetachedCriteria(createCriteria("ORM_SemanaAgregadas"));
	}
	
	public Contract uniqueContract(PersistentSession session) {
		return (Contract) super.createExecutableCriteria(session).uniqueResult();
	}
	
	public Contract[] listContract(PersistentSession session) {
		List list = super.createExecutableCriteria(session).list();
		return (Contract[]) list.toArray(new Contract[list.size()]);
	}
}

